package com.mylove.bindviewlib;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import androidx.annotation.NonNull;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.benyanyi.viewbind.ViewBind;
import com.benyanyi.viewbind.annotation.BindView;
import com.benyanyi.viewbind.annotation.OnClick;

/**
 * @author YanYi
 * @date 2020/05/07 10:26
 * @email ben@yanyi.red
 * @overview
 */
public class TestDialog extends Dialog {
    @BindView(R.id.but)
    private Button but;

    public TestDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_test);
        ViewBind.bind(this);
        but.setText("哈哈哈");
    }

    @OnClick(R.id.but)
    private void onClick(View view) {
        if (view.getId() == R.id.but) {
            Toast.makeText(this.getContext(), "哈哈哈", Toast.LENGTH_SHORT).show();
        }
    }

}
